feat(middleware): add a hook to inspect HTTP responses - #3074
Draft
pimlock wants to merge 4 commits into
Draft
Conversation
pimlock
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 1, 2026 06:10
This was referenced Sep 1, 2026
pimlock
marked this pull request as draft
September 1, 2026 06:18
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
pimlock
force-pushed
the
2691-http-response-runtime/pimlock
branch
from
September 2, 2026 23:35
e676146 to
b4aded6
Compare
Base automatically changed from
2691-http-response-interface/pimlock
to
main
September 4, 2026 21:40
pimlock
force-pushed
the
2691-http-response-runtime/pimlock
branch
from
September 4, 2026 21:40
b4aded6 to
cf6faa7
Compare
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
pimlock
force-pushed
the
2691-http-response-runtime/pimlock
branch
from
September 5, 2026 01:49
cf6faa7 to
bdfa18c
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-3074.docs.buildwithfern.com/openshell |
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement HTTP response processing before delivery to the sandbox, using the merged #3073 contract. Keep the configured-literal content guard semantic across request, response, and WebSocket hooks, and move the path-driven contract demonstrations into one standalone protocol example.
Related Issue
Part of #2691. Builds on merged #3072 and #3073.
Changes
WHOLE_BODY_BYTES; unavailable inspection returns a middleware failure. Clean bodies pass unchanged, matching bodies are redacted or blocked withcontent_match, and trailers pass unchanged.supervisor-middleware-protocolwith request, response, and WebSocket modules, a standalone manifest and lockfile, policy, local fixture, and smoke launcher. It demonstrates request/message replacement, response headers, complete-body and streaming transforms, trailers, content-length/chunked/close-delimited framing, and deterministic pre-commit blocking.Testing
mise run pre-commitpasses.cargo test --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --offline: 15 tests pass.cargo test --manifest-path examples/supervisor-middleware-protocol/Cargo.toml --offline: 8 tests pass.bash -npasses for both smoke scripts; Python fixture/client syntax checks pass.CONTENT_GUARD_SMOKE_DRIVER=docker bash examples/supervisor-middleware-content-guard/smoke.sh --test-suite: passes response pass-through, redaction, denial, and guarded/unguarded requests through external middleware.PROTOCOL_SMOKE_DRIVER=docker bash examples/supervisor-middleware-protocol/smoke.sh --test-suite: passes request, WebSocket, and all response demonstrations through external middleware.mise run testandmise run ciare not green on this branch. The runs reached failures in unchanged server JWKS tests:duplicate_kid_conflicting_algorithms_poison_pillandkey_ops_verify_accepted_sign_only_rejectedreturnedInternalinstead ofUnauthenticated. The latter passes in isolation. Newer main fixes the shared fixture lifetime in test(server): stabilize JWKS validation tests #3225; that unrelated change is not included here.The first test attempt also inherited
tag.gpgsign=true, breaking temporary lightweight-tag fixtures. Subsequent test/CI commands usedGIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=tag.gpgsign GIT_CONFIG_VALUE_0=falsefor the test process only. A README lint error found by CI was corrected and verified by the final pre-commit run.Checklist
PR #3075 was stacked on the old #3074 history and needs realignment after this branch stabilizes.